<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script th:src="@{/statics/未压缩版.js}" type="text/javascript"></script>
    <link th:href="@{/statics/css/login.css}" type="text/css" rel="stylesheet">
    <link th:href="@{/statics/layui-v2.7.6/layui/css/layui.css}" type="text/css" rel="stylesheet">
    <script th:src="@{/statics/layui-v2.7.6/layui/layui.js}" type="text/javascript"></script>
    
</head>
<body>
<div class="login">
    <form th:action="@{/user/login}" method="post">
        <div class="m-login-bg">
            <div class="m-login">
                <div class="t1">瀚唐人事管理<span class="s1">PM</span><span class="s2">1.0</span>系统</div>
                <div class="m-login-warp">
                    <span class="span">请先登录再访问网站</span>
                    <p class="p1"><img src="/statics/images/login/12.png"></p>
                    <br>
                    <br>
                    <p class="copyright" style="width: 640px">兼容浏览器IE8+，最佳分辨率1280*800.<br>
                        2022 @ 淮安瀚唐 https://entdict.58.com/enterpriselibrary/index/detail/1?aid=6361835606&from=2</p>
                    <form class="layui-form">
                        <div class="layui-form-item">
                            <input type="text" name="loginname" required lay-verify="required" placeholder="用户名" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-item" style="margin-top: -180px">
                            <input type="text" name="PASSWORD" required lay-verify="required" placeholder="密码" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-item m-login-btn" style="width: 200px;margin-left: 300px;margin-top: -120px;">
                            <div class="layui-inline">
                                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="login">登录</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

    </form>

</div>

<script>
    layui.use(['form', 'layedit', 'laydate'], function() {
        var form = layui.form(),
            layer = layui.layer;


        //自定义验证规则
        form.verify({
            loginname: function(value) {
                if(value.length < 1) {
                    return '标题至少得1个字符啊';
                }
            },
            PASSWORD: [/(.+){1,12}$/, '密码必须1到12位'],
            // verity: [/(.+){6}$/, '验证码必须是6位'],

        });


        //监听提交
        form.on('submit(login)', function(data) {
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });

    });
</script>
</body>
</html>